<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>提取链接</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
</head>
<body>
  <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 20px 0 0;">


    <div class="layui-form-item">
      <label class="layui-form-label">入口章节</label>
      <div class="layui-input-block">
        <select name="chapter_no" lay-verify="required">
          {foreach $chapters as $k => $v}
          <option value="{$v->chapter_no}">第{$v->chapter_no}章</option>
          {/foreach}
        </select>
      </div>
    </div>


    <div class="layui-form-item">
      <label class="layui-form-label">链接名称</label>
      <div class="layui-input-block">
        <input type="text" name="name" lay-verify="required" placeholder="自定义链接名称" autocomplete="off" class="layui-input">
      </div>
    </div>


    <div class="layui-form-item">
      <label class="layui-form-label">选择App</label>
      <div class="layui-input-block">
        <select name="quick_id" lay-verify="required" lay-search>
          {foreach $qas as $k => $v}
          <option value="{$v->id}">{$v->name}</option>
          {/foreach}
        </select>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">引导加桌</label>
      <div class="layui-input-block">
        <input type="checkbox" name="enter_pop" lay-skin="switch" lay-text="开启|关闭" value="1">
      </div>
      <div class="layui-input-block" style="width: 370px;">
        <div class="layui-form-mid layui-word-aux">开启后未加桌用户从推广链接进入阅读页，立即引导加桌；</div>
      </div>
    </div>


    <div class="layui-form-item">
      <label class="layui-form-label">强制加桌</label>
      <div class="layui-input-block">
        <input type="radio" name="force_switch" value="1" title="开启" checked lay-filter="desktopType">
        <input type="radio" name="force_switch" value="0" title="关闭" lay-filter="desktopType">
      </div>
      <div class="layui-input-block" style="width: 370px;">
        <div class="layui-form-mid layui-word-aux">开启后在“强加桌章节”页点击下一章时会弹出加桌弹窗，该弹窗未加桌不许关闭</div>
      </div>
    </div>

    <div class="layui-form-item force">
      <label class="layui-form-label">强加桌章节</label>
      <div class="layui-input-block">
        <input type="number" name="force_chapter_no" id="force_chapter_no" placeholder="输入章节序号，不填默认为当前入口章节" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">充值模版</label>
      <div class="layui-input-block">
        <select name="template_id" lay-verify="required" lay-search>
          <option value="0">请选择</option>
          {foreach $temps as $k => $v}
          <option value="{$v->id}">{$v->name}</option>
          {/foreach}
        </select>
      </div>
      <div class="layui-input-block" style="width: 370px;">
        <div class="layui-form-mid layui-word-aux">可不选，默认使用平台设置的充值项</div>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">千字/书币</label>
      <div class="layui-input-block">
        <input type="text" name="chapter_words_fee"  placeholder="不填则为书籍默认千字/书币" autocomplete="off" class="layui-input">
      </div>
    </div>


    <div class="layui-form-item layui-hide">
      <button class="layui-btn" lay-submit lay-filter="LAY-user-role-submit" id="LAY-user-role-submit">提交</button>
    </div>
  </div>

  <script src="/static/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/static/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form' ], function(){
    var $ = layui.$
    ,form = layui.form;
    form.on('radio(desktopType)', function(data){
      if (data.value == 1){
          $(".force").removeClass('layui-hide');
      }else {
        $(".force").addClass('layui-hide');
        $("#force_chapter_no").val('');
      }
    });

  })
  </script>
</body>
</html>